<template>
  <el-image-viewer
    :url-list="preview"
    v-if="show"
    :teleported="true"
    :hide-on-click-modal="true"
    @close="show = false"
  ></el-image-viewer>
</template>

<script setup lang="ts">
import { ref } from "vue";

const show = ref(false);

const preview = ref<string[]>([]);

const open = (url: string) => {
  preview.value = [url];
  show.value = true;
};

defineExpose({ open });
</script>

<style></style>
